package cn.fintecher.pangolin.entity.elastic;

import cn.fintecher.pangolin.common.enums.BaseSelect;
import cn.fintecher.pangolin.common.enums.OtherFollowType;
import cn.fintecher.pangolin.common.utils.Constants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @Auther: xiaqun
 * @Description: 其他记录实体
 * @Date: 14:51 2019/9/17
 */

@Data
@Document(indexName = Constants.OTHER_RECORD, type = Constants.OTHER_RECORD, shards = 1, replicas = 0)
@ApiModel(value = "其他记录实体", description = "其他记录实体")
public class OtherRecord {

    @ApiModelProperty(value = "主键ID")
    @Id
    private String id;

    @ApiModelProperty(value = "案件ID")
    private String caseId;

    @ApiModelProperty(value = "案件编号")
    private String caseNumber;

    @ApiModelProperty(value = "委托方ID")
    private String principalId;

    @ApiModelProperty(value = "委托方名称")
    private String principalName;

    @ApiModelProperty(value = "证件号")
    private String certificateNo;

    @ApiModelProperty(value = "查找时间")
    private Date findTime;

    @ApiModelProperty(value = "类型")
    private OtherFollowType otherFollowType;

    @ApiModelProperty(value = "是否信息更新")
    private String isUpdate;

    @ApiModelProperty(value = "批次号")
    private String batchNumber;

    @ApiModelProperty(value = "记录")
    private String record;

    @ApiModelProperty(value = "跟进人ID")
    private String operatorId;

    @ApiModelProperty(value = "跟进人姓名")
    private String operatorName;

    @ApiModelProperty(value = "操作时间")
    private Date operateTime;

    @ApiModelProperty(value = "撤销标记 0-未撤销 1-已撤销")
    private Integer flag = 0;

    @ApiModelProperty(notes = "回复内容")
    private String replayContent;

    @ApiModelProperty(notes = "回复时间")
    @Field(type = FieldType.Long)
    private Date replayTime;

    @ApiModelProperty(notes = "回复人")
    private String replyName;

    @ApiModelProperty(notes = "是否回复")
    private BaseSelect isOperate = BaseSelect.NO;

    public void process(String id, String name, Date date) {
        this.operatorId = id;
        this.operatorName = name;
        this.operateTime = date;
    }
}
